home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / open-look / 03-xview < prev    next >
Encoding:
Text File  |  1995-07-25  |  6.9 KB  |  186 lines

  1. Subject: OPEN LOOK GUI FAQ 03/04: the XView Toolkit
  2. Newsgroups: comp.windows.open-look,alt.toolkits.xview,comp.windows.news,alt.sys.sun,alt.toolkits.intrinsics,comp.answers,alt.answers,news.answers
  3. From: lee@sq.sq.com (Liam Quin)
  4. Date: Mon, 24 Oct 94 22:06:23 GMT
  5.  
  6. Archive-name: open-look/03-xview
  7.  
  8.  
  9. This is a new FAQ.
  10.  
  11. Contributions will be welcomed; mail them to lee@sq.com (Liam Quin),
  12. preferably including "XView FAQ" in the Subject line.
  13.  
  14. Contents:
  15.     Sources Of Information:
  16.     The Future of XView
  17.     Scrolling Lists
  18.     How do I keep a pop-up window displayed after a button is pressed?
  19.     how do I make an XView button look pressed?
  20.     OpenWindows 3 imake doesn't work properly
  21.     The pop-up menu in my canvas has funny colours
  22.     The second ttysw in my program doesn't work
  23.     How do arrange to have a (Cancel) button to stop a calacuation?
  24.     How do I put panel items on a canvas?
  25.  
  26.  
  27. Subject: Sources Of Information:
  28.     netnews newsgroups:
  29.     alt.toolkits.xview    - best for specific XView questions
  30.     comp.windows.open-look
  31.     comp.windows.x        - highest volume
  32.     Watch for Frequently Asked Questions lists (such as this) in these
  33.     groups.  The article you are reading is part of the alt.toolkits.xview
  34.     and comp.windows.open-look FAQ.
  35.  
  36.     Books:
  37.     See the comp.windows.open-look FAQ, which lists several books on X
  38.     and XView.  The O'Reiily books in particular are recommended.
  39.     
  40.     Source: code:
  41.     the FTP site export.lcs.mit.edu, in directory /contrib, has the
  42.     full XView source (the latest release is 3.2), together with lots
  43.     of X programs.  Programs whose name ends in "tool" or starts with
  44.     "xv" are often based on XView.
  45.  
  46. Subject: The Future of XView
  47.  
  48.     XView is no longer a Strategic Direction for Sun.  It will be supported
  49.     for the next few years, but new features will not be added.
  50.     On the other hand, the source is publicly available.
  51.     XView is included with SunOS and Solaris, and also with some versions
  52.     of Linux.
  53.  
  54.     Sun will be moving to a motif-like user interface in 1995, with the
  55.     shipping of COSE/CDE.  At that time, XView will be less interesting to
  56.     many people.
  57.  
  58.     Since it's probably the easiest X toolkit to use that's easily and
  59.     widely available, XView will probably be widely used for a while.
  60.  
  61.  
  62.  
  63. Subject: Scrolling Lists
  64.  
  65. @ How do I set the font of individual Scrolling List items?
  66.     PANEL_LIST_FONT takes an int row_number and an Xv_opaque font_handle.
  67.     PANEL_LIST_FONTS take a NULL terminated list of Xv_opaque font_handles.
  68.     There is no easy way to make an entire list fixed width font.
  69.     You have to make sure that you always specify PANEL_LIST_FONT when you
  70.     insert a new row into that list, or write a convenience function
  71.     insert_row(list, row, string) that hides the nasty bits.
  72.     The most efficient way to do this involves creating an Xv_attr array
  73.     to do lots of insertions at once, complete with PANEL_LIST_FONTs.
  74.  
  75.     If you give both PANEL_LIST_STRING and PANEL_LIST_FONT in the same
  76.     xv_set() call, PANEL_LIST_STRING must be given first, or the default
  77.     font will be used.
  78.  
  79. @ How do I set the selected item of an exclusive list with required choice?
  80.     If you have a PANEL_LIST with a required choice, and the list is
  81.     exclusive, you must de-select the old item and select the new one in
  82.     a single xv_set() call, for example:
  83.  
  84.     xv_create(owner, PANEL_LIST,
  85.         ....
  86.         PANEL_CHOOSE_ONE, TRUE,    /* only one entry can be selected */
  87.         PANEL_CHOOSE_NONE, FALSE,  /* one entry must be selected      */
  88.         NULL
  89.     );
  90.  
  91.     xv_set(List,
  92.         PANEL_CHOOSE_NONE, TRUE,
  93.         PANEL_LIST_SELECT, xv_get(List, PANEL_LIST_FIRST_SELECTED), FALSE,
  94.         PANEL_LIST_SELECT, row, TRUE,
  95.         PANEL_CHOOSE_NONE, FALSE,
  96.         NULL
  97.     );
  98.  
  99.     Note: you may find it useful to start with PANEL_CHOOSE_NONE true so that
  100.     the list comes up with no selection; and then on the first selection set
  101.     PANEL_CHOOSE_NONE to FALSE so that a selection is required.
  102.  
  103.  
  104.  
  105. Subject: How do I keep a pop-up window displayed after a button is pressed?
  106.     In the button callback, do
  107.         xv_set(button, PANEL_NOTIFY_STATUS, XV_ERROR, NULL);
  108.     This will keep the window visible.
  109.     You might also need to investigate the MENU_NOTIFY_STATUS attribute.
  110.  
  111. Subject: how do I make an XView button look pressed?
  112.     call panel_begin_preview() and panel_cancel_preview(); these are
  113.     documented in -- er -- the XView 3 source...
  114.  
  115. Subject: OpenWindows 3 imake doesn't work properly
  116.     Here is Greg Earle's patch, to be applied in $OPENWINHOME; note that you
  117.     should edit lib/config/sun.cf afterwards to get OSName and
  118.     OSMinorVersion right (MinorVersion is 1 in SunOS 4.1.2, for example).
  119.     I have edited the patch a little, so any bugs are mine [lee@sq.com] :-)
  120.  
  121. *** bin/xmkmf.orig    Wed Sep 18 07:02:02 1991
  122. --- bin/xmkmf    Tue Aug  6 00:39:20 1991
  123. ***************
  124. *** 30,34 ****
  125.   
  126.   elif [ -n "$OPENWINHOME" ]; then
  127. !     args="-DUseInstalled $OPENWINHOME/lib/config"
  128.   
  129.   else
  130. --- 30,34 ----
  131.   
  132.   elif [ -n "$OPENWINHOME" ]; then
  133. !     args="-I$OPENWINHOME/lib/config -DUseInstalled -DXCOMM='/**/#'"
  134.   
  135.   else
  136. *** lib/config/site.def.orig    Wed Sep 18 01:26:19 1991
  137. --- lib/config/site.def    Tue Aug  6 00:44:37 1991
  138. ***************
  139. *** 0 ****
  140. --- 1,7 ----
  141. + #define BinDir $(OPENWINHOME)/bin
  142. + #define LibDir $(OPENWINHOME)/lib
  143. + #define IncRoot $(OPENWINHOME)/share/include
  144. + #define InstallNonExecFile(file,dest)                    @@\
  145. + install:: file                                @@\
  146. +     $(INSTALL) -c $(INSTDATFLAGS) file dest
  147. + #define NullParameter
  148.  
  149.  
  150. Subject: The pop-up menu in my canvas has funny colours
  151.     You need to use CMS_CONTROL_CMS when you create the CMS for your canvas.
  152.     This allocates the OPEN LOOK UI 3D colors at the start of the colormap.
  153.     The foreground color lives right at the end.
  154.  
  155. Subject: The second ttysw in my program doesn't work
  156.     XView only supports one ttysw per program!
  157.  
  158. Subject: How do arrange to have a (Cancel) button to stop a calacuation?
  159.     When you are doing cpu-intensive calculations, your program probably
  160.     isn't calling the XView notifier, so that button presses aren't noticed
  161.     until the computation is over.
  162.     There are several possible solutions:
  163.     * use the implicit or explicit notify displatch mechanism, described
  164.       in the Notifier chapter of the XView Programming Manual (O'Reilly);
  165.     * use multiple processes, and send signals;
  166.     * split up the work into small chunks and use notify_stop to return to
  167.       the main loop for each chunk.
  168.  
  169. Subject: How do I put panel items on a canvas?
  170.     You don't.
  171.     You can, however, draw on a panel, as if it was a canvas.
  172.     Another alternative is to use olgx to render the controls, but this is
  173.     a little tricky.
  174.  
  175.  
  176. END of XView FAQ
  177.  
  178. # $Id: ol3.faq,v 1.2 1994/09/02 22:08:38 lee Exp $
  179.  
  180. -- 
  181. Liam Quin, Manager of Contracting, SoftQuad Inc +1 416 239 4801 lee@sq.com
  182. HexSweeper NeWS game;OPEN LOOK+XView+mf-fonts FAQs;lq-text unix text retrieval
  183. SoftQuad HoTMetaL: ftp.ncsa.uiuc.edu:Web/html/hotmetal, and also doc.ic.ac.uk:
  184. packages/WWW/ncsa/..., gatekeeper.dec.com:net/infosys/Mosaic/contrib/SoftQuad/
  185.  
  186.